Guidelines for constructing a query
With Microsoft Query, there are two ways to construct a query. To ensure that you get the
results you're looking for, keep the following guidelines in mind:
- Use Query view when you want to create a simple query.
Query view presents query designs visually while giving you a great deal of control because you
can narrow your result set either by creating an inner
join or outer join or by using
criteria. Expressions are calculations you can perform
by using operators, functions, field names, and constants. You can do more complex filtering by using
criteria. You can view the result set in Microsoft Query. When you're sure the result set contains
the data you want, you can return it to Microsoft Excel. After you create the query, you can use it
in Microsoft Excel or Microsoft Query.
- If you know Structured Query Language (SQL), use SQL view to directly edit a query's
SQL SELECT statement. If you create a complex query in SQL view, and then switch to
Query view, Microsoft Query might not be able to display the query's design because it
might not be able to interpret a portion of the syntax you used. In these cases, Query
view is no longer available, but the result set is still displayed, and you must make any
changes to the query, such as adding or removing fields, in SQL view. For more information
about SQL, see the documentation for your database.
Related topics
Create a query
View or edit SQL statements in a query
How joins affect the result set in a query